package com.yonxao.demo.crud.core;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.yonxao.demo.crud.annotation.serializer.EntityEnumDeserializer;
import com.yonxao.demo.crud.annotation.serializer.EntityEnumSerializer;
import com.yonxao.demo.crud.config.swagger.SwaggerDisplayEnum;

/**
 * 实体类中枚举属性的超类
 *
 * @author yonxao
 * @date 2021/3/20
 */
@SwaggerDisplayEnum
@JsonSerialize(using = EntityEnumSerializer.class)
@JsonDeserialize(using = EntityEnumDeserializer.class)
public interface IEntityEnum {

    /**
     * 枚举值序列化和反序列化的字段
     *
     * @return 值
     */
    Byte getCode();

    /**
     * 该值的描述
     *
     * @return 描述
     */
    String getDescription();
}